Uec3.RegisterCompanyWindow = Ext.extend(Ext.app.Module, {
	id : 'registerCompany',
	type : 'common/registerCompany',

	/**
	 * Initialize this module. This function is called at startup (page
	 * load/refresh).
	 */
	init : function(initParams) {
	},

	getComponents : function(module) {

		var registerCompany_dist_cmb;
		var registerCompany_city_cmb;
		var registerCompany_prov_cmb;
		var registerCompany_ajax;
		var registerCompanyForm;
        var businessLicenseFile1;
        var taxCertificationFile;
        var companyType_combox;
		var componentCompanyInits = function() {
			
			function choosePicture(name, v,hiddenName) {

					if (Ext.util.Format.lowercase(v).lastIndexOf(".jpg") != -1
							|| Ext.util.Format.lowercase(v).lastIndexOf(".gif") != -1
							|| Ext.util.Format.lowercase(v).lastIndexOf(".png") != -1) {
								
										
											registerCompanyForm.getForm()
												.findField(hiddenName).setValue(v);		
								
					} else {
						Ext.Msg.alert("错误", "请选择正确的图片文件");
						registerCompanyForm.getForm().findField(name)
								.reset();
					}

				}

			
			

			// 区县下拉框
			registerCompany_dist_cmb = getDistrictCombox(Uec3.App.Constants.homeUrl);
			registerCompany_dist_cmb.setWidth(100);
			//registerCompany_dist_cmb.allowBlank=false;
			registerCompany_dist_cmb.blankText="公司信息地区必须填写";
			registerCompany_dist_cmb.anchor="99%";
			// 城市下拉框
			registerCompany_city_cmb = getCityCombox(Uec3.App.Constants.homeUrl,
					registerCompany_dist_cmb);
			registerCompany_city_cmb.setWidth(100);
			registerCompany_city_cmb.allowBlank=false;
			registerCompany_city_cmb.blankText="公司信息城市必须填写";
			registerCompany_city_cmb.anchor="99%";
			// 省份下拉框
			registerCompany_prov_cmb = getProvinceCombox(Uec3.App.Constants.homeUrl,
					registerCompany_city_cmb, registerCompany_dist_cmb);
			registerCompany_prov_cmb.setWidth(100);
			registerCompany_prov_cmb.allowBlank=false;
			registerCompany_prov_cmb.blankText="公司信息省份必须填写";
			registerCompany_prov_cmb.anchor='99%';

			businessLicenseFile1 = new Ext.form.FileUploadField({

				emptyText : '请选择营业执照副本复印件...',
				style : "margin-left:6px",
				height : 30,
				width : 320,
				columnWidth:0.45,
				name : 'businessLicenseFile',
				buttonText : '',
				blankText : "营业执照副本复印件不允许为空",
				buttonCfg : {
					iconCls : 'icon-photo'
				},

				listeners : {
					'fileselected' : function(fb, v) {

						choosePicture('businessLicenseFile', v,"businessLicenseFileName");

					}
				}
			});

			taxCertificationFile = new Ext.form.FileUploadField({

				emptyText : '请选择税务登记证副本复印件...',
				style : "margin-left:6px",
				columnWidth:0.45,
				height : 30,
				width : 320,
				blankText : "税务登记证副本复印件不允许为空",
				name : 'taxCertificationFile',
				buttonText : '',
				buttonCfg : {
					iconCls : 'icon-photo'
				},

				listeners : {
					'fileselected' : function(fb, v) {
			
						choosePicture('taxCertificationFile', v,"taxCertificationFileName");

					}
				}
			});

			var companyType_store = new Ext.data.Store({
				proxy : new Ext.data.HttpProxy({
							url : Uec3.App.Constants.homeUrl
									+ '/dictionary/findByVarGroup.do?group=requestCompany_rtype'
						}),
				reader : new Ext.data.JsonReader({
							root : '',
							fields : [{
										name : 'varIndex'
									}, {
										name : 'varName'
									}]
						})
			});
						
			    companyType_combox = new Ext.form.ComboBox({
				hiddenName : 'requestCompanyType',
				fieldLabel : '公司类型',
				blankText : '公司类型不能为空',
				store : companyType_store,
				emptyText : '--请选择--',
				mode : 'local',
				anchor :'99%',
				width:154,
				triggerAction : 'all',
				valueField : 'varIndex',
				displayField : 'varName',
				loadingText : '加载中...',
				editable : false,
				selectOnFocus : true,
				forceSelection : true
			});		
		
		         //加载公司类型
				companyType_store.load();
	
//{ xtype:'textfield',fieldLabel:'法人身份证',name:'contactorIdentityCode',anchor:'99%',	regex : /(^\d{15}$)|(^\d{17}([0-9]|X|x)$)/,
		//	regexText : '输入的身份证号长度不对，或者号码不符合规定！15位号码应全为数字，18位号码末位可以为数字或x,X'}
			registerCompany_ajax = new Ext.data.Connection();

			registerCompanyForm = new Ext.form.FormPanel({
				labelAlign : 'right',
				frame : true,
				height : 500,
				fileUpload : true,
				labelWidth : 80,
				loadingText : '加载数据中...',
				buttonAlign : 'center',
				items : [ {
      xtype:'fieldset',
      title: '基本信息',
      height:120,
      collapsed: false,
      items :[
        {
          layout:'column',
          items:[
           {
             columnWidth:0.5,
             items:[
               {
                layout:'form',
                labelWidth:70,
                items:[{name : 'id',fieldLabel : 'ID', xtype : 'hidden'},
                       {name : 'contactorIdFileName',fieldLabel : '身份证名称', xtype : 'hidden'},
                       {name : 'businessLicenseFileName',fieldLabel : '营业执照名称', xtype : 'hidden'},
                       {name : 'taxCertificationFileName',fieldLabel : '税号名称', xtype : 'hidden'},
                {name : 'creatorId',fieldLabel : 'ID', xtype : 'hidden'},
                       {name : 'areaId',fieldLabel : 'areaId', xtype : 'hidden'},
                  	{xtype:'textfield',fieldLabel:'公司名称', name:'name',width:150,anchor:'99%',blankText:"公司名称不允许为空",maxLengthText : "公司名称长度不大于30位"}]
               },
               	{
                layout:'form',
                labelWidth:70,
                items:[
                  	{xtype:'textfield',fieldLabel : '公司简称',name : 'simpleName',anchor:'99%',maxLength:30,maxLengthText : "公司简称长度不大于20位"}]
               },
               		{
                layout:'column',
                items:[{
                    columnWidth:0.46,
                    items:[{
                         layout:'form',
                         labelWidth:70,
                         items:[{xtype:'textfield',fieldLabel:'负责人/法人',name:'contactor',anchor:'99%',blankText:"公司法人名称必须填写",maxLength:30,maxLengthText : "负责人/法人长度不大于20位"} ]}]
                   },{
                    columnWidth:0.54,
                    items:[{
                         layout:'form',
                         labelAlign:'right',
                         labelWidth:70,
                         items:[companyType_combox]}]
                  }
                ]
               }]
           },{
             columnWidth:0.5,
             items:[{
                layout:'form',
                labelWidth:70,
                labelAlign:'right',
                items:[{xtype:'textfield',fieldLabel:'经营项目',name:'business',blankText:"公司经营项目必须填写",anchor:'99%',maxLength:30,maxLengthText : "经营项目长度不大于30位"}]
               },{
                layout:'form',
                labelWidth:70,
                items:[
                  	{xtype:'textfield',fieldLabel : '英文名称',anchor:'99%',name : 'nameEn',maxLength:30,maxLengthText : "英文名称长度不大于30位"}]
               },{
                layout:'column',  
                labelWidth:70,              
                items:[
    		               {
    				             columnWidth:0.4,
    				             items:[{
    				                 layout:'form',
    				                 labelWidth:70,
    				                 items:[registerCompany_prov_cmb]}]
    				           },{
    				           	 columnWidth:0.3,
    				             items:[{
    				                 layout:'form',
    				                 labelWidth:30,
    				                 items:[registerCompany_city_cmb]}]
    				           },{
    				           	 columnWidth:0.3,
    				             items:[{
    				             		layout:'form',
    				                    labelWidth:30,
    				                    items:[registerCompany_dist_cmb]}]
    				           }
                    ]
                }]
               }]
             }]
      },{
		xtype : 'fieldset',
		title : '实名信息',
		height: 125,		
		items:[{
			xtype : 'panel',
			defaultType : 'textfield',
			anchor : '99%',
			layout : 'column',
			labelAlign:'right',
			style : "margin-left:10px",
			border : false,
			items : [{
				        columnWidth:0.1,
						xtype : 'label',
						cls : "x-form-field",
						style : "margin-top:4px",
						text : '法人身份证:'

					}, {
						columnWidth:0.3,
						name : 'contactorIdentityCode',
						//fieldLabel : "法人身份证",
						blankText : '请填写身份证号',
						regex:/^[0-9]+$/,
						regexText:'请输入正确的数字格式',
						maxLength:18,
						minLengthText:"身份证长度不能大于18位",
						width : 200

					},

					{
						xtype : 'label',
						columnWidth:0.15,
						cls : "x-form-field",
						style : "margin-top:4px;margin-left:20px",
						text : '法人身份证复印件:'

					}, {
						columnWidth:0.45,
						xtype : 'fileuploadfield',
						emptyText : '请选择法人身份证复印件...',
						name : 'contactorIdentityFile',
						width : 320,
						style : "margin-left:6px",
						height : 30,
						buttonText : '',
						blankText : "法人身份证复印件不允许为空",
						buttonCfg : {
							iconCls : 'icon-photo'
						},
						listeners : {
							'fileselected' : function(fb, v) {

								choosePicture(
										'contactorIdentityFile',v,"contactorIdFileName");

							}
						}
					}]
		},
		{
			xtype : 'panel',
			defaultType : 'textfield',
			style : "margin-left:10px",
			layout : 'column',
			labelAlign:'right',
			border : false,
			items : [{
						xtype : 'label',
						columnWidth:0.1,
						text : '税号:',
						cls : "x-form-field",
						style : "margin-top:4px;"
					}, {

						name : 'taxCode',
						width : 200,
						regex:/^[0-9]+$/,
						regexText:'请输入正确的数字格式',
						maxLength:15,
						minLengthText:"税号长度不能大于15位",
						columnWidth:0.3,
						blankText : '税号必须填写'
					}, {
						xtype : 'label',
						text : '税务登记证复印件:',
						columnWidth:0.15,
						cls : "x-form-field",
						style : "margin-top:4px;margin-left:20px"
					}, taxCertificationFile]
		},{
			xtype : 'panel',
			defaultType : 'textfield',
			style : "margin-left:10px",
			anchor : '99%',
			labelAlign:'right',
			layout : 'column',
			border : false,
			items : [{
						xtype : 'label',
						cls : "x-form-field",
						columnWidth:0.1,
						style : "margin-top:4px;",
						text : '工商注册号:'

					}, {

						name : 'code',
						width : 200,
						regex:/^[0-9]+$/,
						regexText:'请输入正确的数字格式',
						maxLength:15,
						minLengthText:"工商注册号长度不能大于15位",
						columnWidth:0.3,
						blankText : '工商注册号必须填写'
					},

					{
						xtype : 'label',
						cls : "x-form-field",
						columnWidth:0.15,
						style : "margin-top:4px;margin-left:20px;",
						text : '营业执照复印件:'

					}, businessLicenseFile1]
		}]
	},{
		xtype : 'fieldset',
		title : '联系方式',
		height: 135,		
		items:[{
		        layout:'column',
		        items:[{
		           	 columnWidth:0.5,
		             items:[{
		                 layout:'form',
		                 labelWidth:70,
		                 labelAlign:'right',
		                 items:[{xtype:'textfield',fieldLabel : '通讯地址',name : 'address',anchor:'99%',maxLength:30,maxLengthText : "通讯地址长度不大于30位"}]}]
		           },{
		           	 columnWidth:0.25,
		             items:[{
		                 layout:'form',
		                 labelWidth:56,
		                 labelAlign:'right',
		                 items:[{xtype:'textfield',fieldLabel : '邮编',name : 'postcode',
														regex:/^[0-9]\d{5}(?!\d)$/,
														regexText:'请输入正确的邮政编码格式',anchor:'99%'}]}]
		           }
		        ]
		       },{
			       	 layout:'column',
			       	 items:[{
			             columnWidth:0.5,
			       	     items:[{layout:'form',
			       	            labelWidth:56, labelAlign:'right',items:[{xtype : 'textfield',fieldLabel : 'MSN号',
															name : 'msn',
															anchor:'99%',
															vtype:'email',
															vtypeText:'请填写正确的MSN格式(如:huarun@hotmail.com)'}]}]
			       	   },{
			             columnWidth:0.5,
			       	     items:[{
			       	     		layout:'form',
			       	            labelWidth:56,
			       	            labelAlign:'right',
			       	            items:[{xtype : 'textfield',fieldLabel:'网址',name : 'web',anchor:'99%',maxLength:30,maxLengthText : "网址长度不大于30位"}]
			       	       }]
			       	   }]
			       },{
		       	 layout:'column',
		       	 items:[
		       	   {
		       	     columnWidth:0.25,
		       	     items:[{
		       	         layout:'form',
		       	         labelWidth:70,
		       	         items:[{xtype:'textfield',fieldLabel:'开户行',name:'bankName',anchor:'99%',maxLength:30,maxLengthText : "开户行长度不大于30位"}]
		       	       },{
		       	       	 layout:'form',
		       	       	 labelWidth:70,
		       	         items:[{xtype:'textfield',fieldLabel:'联系电话',name:'tel',maxLength:30,maxLengthText : "联系电话长度不大于30位",anchor:'99%'}]
		       	       }
		       	     ]
		       	   },{
		             columnWidth:0.25,
		       	     items:[{
		       	         layout:'form',
		       	         labelWidth:70,
		       	         labelAlign:'right',
		       	         items:[{xtype:'textfield',fieldLabel:'银行账号',name:'bankCode',anchor:'99%',maxLength:30,maxLengthText : "银行账号长度不大于30位"}]
		       	       },{
		       	       	 layout:'form',
		       	       	 labelWidth:70,
		       	       	 labelAlign:'right',
		       	         items:[{xtype:'textfield',fieldLabel:'传真电话',name:'fax',maxLength:30,maxLengthText : "传真电话长度不大于30位",anchor:'99%'}]
		       	       }
		       	     ]
		       	   },{
		             columnWidth:0.5,
		       	     items:[{
		       	     		layout:'form',
		       	            labelWidth:56,
		       	            labelAlign:'right',
		       	            items:[{xtype:'textfield',fieldLabel:'发票地址',name:'invoicAddress',anchor:'99%',maxLength:30,maxLengthText : "发票地址长度不大于30位"}]
		       	       },{
		       	       	 layout:'column',
		       	         items:[{
		       	            columnWidth:.5,
		       	            items:[{
		       	                layout:'form',
		       	                labelWidth:56,
		       	                labelAlign:'right',
		       	                items:[{xtype : 'numberfield',
														fieldLabel : 'QQ号',
														name : 'qq',
														regex:/^[1-9]{1}\d{4,12}$/,
														regexText:'请填写正确的qq格式和长度',anchor:'99%'}]}]
		       	           },{
		       	           	columnWidth:.5,
		       	            items:[{
		       	                layout:'form',
		       	                labelWidth:70,
		       	                labelAlign:'right',
		       	                items:[{xtype:'textfield',fieldLabel:'E-Mail',name:'email',anchor:'99%',
														vtype : 'email',
														vtypeText:'请填写正确的邮箱格式(如:huarun@gmail.com)'}]}]
		       	           }]}]
		       	   }]
		       }]
	}],
				buttons : [{
					text : '注册',
					handler : function() {
					companyType_combox.allowBlank = true;
					registerCompanyForm.getForm()
					.findField("taxCertificationFile").allowBlank = true;
					registerCompanyForm.getForm()
					.findField("contactorIdentityFile").allowBlank = true;
					registerCompanyForm.getForm()
					.findField("contactorIdentityCode").allowBlank = true;
					registerCompanyForm.getForm()
					.findField("contactorIdentityCode").regex=/^[0-9]+$/;
					registerCompanyForm.getForm()
					.findField("contactorIdentityCode").regexText='请输入正确的数字格式';
					registerCompanyForm.getForm()
					.findField("contactorIdentityCode").maxLength=18;
					registerCompanyForm.getForm()
					.findField("contactorIdentityCode").minLength=0;
					registerCompanyForm.getForm()
					.findField("contactorIdentityCode").maxLengthText="身份证长度不能大于18位";
					registerCompanyForm.getForm()
					.findField("taxCode").maxLength=15;
					registerCompanyForm.getForm()
					.findField("taxCode").minLength=0;
					registerCompanyForm.getForm()
					.findField("taxCode").maxLengthText="税号长度不能大于15位";
					registerCompanyForm.getForm()
					.findField("taxCode").maxLength=15;
					registerCompanyForm.getForm()
					.findField("taxCode").minLength=0;
					registerCompanyForm.getForm()
					.findField("code").maxLengthText="营业执照长度不能大于15位";
					registerCompanyForm.getForm()
					.findField("name").allowBlank = true;
					registerCompanyForm.getForm()
					.findField("business").allowBlank = true;
					registerCompanyForm.getForm()
					.findField("taxCode").allowBlank = true;
					registerCompanyForm.getForm()
					.findField("code").allowBlank = true;
					registerCompanyForm.getForm()
					.findField("contactor").allowBlank = true;				
					registerCompanyForm.getForm()
					.findField("businessLicenseFile").allowBlank = true;
						
					if (!registerCompanyForm.getForm().isValid()) {

						Ext.Msg.alert("提示", "请按要求正确填写");

						return;

					}
					var formValues = registerCompanyForm.getForm()
							.getValues();
					var jsonAll = Ext.encode(formValues);
					
				registerCompanyForm.getForm().submit({

				url : Uec3.App.Constants.homeUrl
						+'/company/register.do',
				method : "post",
				params:{jsonAll:jsonAll},
				waitMsg : '正在注册公司...',
				success : function(form, action) {
				
				if (action.result.success == "OK"){
							
					  			Ext.Msg.alert("提示","您已经注册成功,可以到公司信息里进行认证!",function(){
									 
									window.location.href= Uec3.App.Constants.homeUrl+ '/desktop/indexNew.do';													
									 
								 })
					
						} else {

					Ext.Msg
						.alert("提示",
							action.result.failure);

						}


			},
				failure : function(form, action) {

					Ext.Msg.alert("错误","网络出现异常，请重先连接");
				}
			});

					
					
					/**registerCompany_ajax.request({
						url : Uec3.App.Constants.homeUrl
								+ '/company/register!doRegister.do',
						success : function(res) {

							var result = Ext.decode(res.responseText);
							if (result.success == "OK") {
                              
								 Ext.Msg.alert("提示","您已经注册成功,可以到公司信息里进行认证!",function(){
									 
										window.location.href= Uec3.App.Constants.homeUrl+ '/desktop/indexNew.do';													
									 
								 })
							   	 						
										
							} else {

								Ext.Msg.alert("提示", result.failure);

							}
						},

						failure : function(res) {

							Ext.Msg.alert('失败', "网络出现异常，请重先连接");

						},

						params : {
							jsonAll : jsonAll
						}

					  });*/
					}

				}, {
					text : '注册并请求个人认证 ',
																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																										
					handler : function() {
				    companyType_combox.allowBlank = false;
					registerCompanyForm.getForm()
					.findField("taxCertificationFile").allowBlank = true;
				     registerCompanyForm.getForm()
					.findField("contactorIdentityFile").allowBlank = false;	
					registerCompanyForm.getForm()
					.findField("contactorIdentityCode").allowBlank = false;
					registerCompanyForm.getForm().findField("contactorIdentityCode").regex =/(^\d{15}$)|(^\d{17}([0-9]|X|x)$)/;
					registerCompanyForm.getForm().findField("contactorIdentityCode").regexText ='输入的身份证号长度不对，或者号码不符合规定！15位号码应全为数字，18位号码末位可以为数字或x,X'
					registerCompanyForm.getForm()
					.findField("name").allowBlank = false;
					registerCompanyForm.getForm()
					.findField("business").allowBlank = false;
					registerCompanyForm.getForm()
					.findField("taxCode").allowBlank = true;
					registerCompanyForm.getForm()
					.findField("code").allowBlank = true;
					registerCompanyForm.getForm()
					.findField("contactor").allowBlank = false;				
					registerCompanyForm.getForm()
					.findField("businessLicenseFile").allowBlank = true;		
				
	    
		if (!registerCompanyForm.getForm().isValid()) {

			Ext.Msg.alert("提示", "请按照要求进行正确操作");

			return;

		}
           var value = registerCompanyForm.getForm().getValues();
           
           var  jsonAll = Ext.encode(value);
                     
		    Ext.Msg.confirm('提示', "如果个人认证一旦成功，除了税号和工商注册号,其他公司基本信息包括公司类型将不能再修改,还继续执行吗?",
						function(button) {
			if (button == 'yes') {

				registerCompanyForm.getForm().submit({

				url : Uec3.App.Constants.homeUrl+ '/certify/registerAndCertify.do',
				method : "post",
				params:{jsonAll:jsonAll,requestRealType:1},
				waitMsg : '正在保存数据...',
				success : function(form, action) {
				        

					 Ext.Msg.alert("提示","您已经注册成功,并已经请求了个人认证!",function(){
						 
							window.location.href= Uec3.App.Constants.homeUrl+ '/desktop/indexNew.do';													
						 
					 })
					
				},
				failure : function(form, action) {

					Ext.Msg.alert("错误", action.result.failure);
				}
			});
							}
						});
			},
					style : "margin-left:20px"
				},{	
					text : '注册并请求公司认证',

					handler : function() {
					companyType_combox.allowBlank = false;
					registerCompanyForm.getForm()
					.findField("taxCertificationFile").allowBlank = false;	
					registerCompanyForm.getForm().findField("taxCode").maxLength=15
					registerCompanyForm.getForm().findField("taxCode").minLength=15
					registerCompanyForm.getForm().findField("taxCode").maxLengthText ='税号的长度等于15位'
					registerCompanyForm.getForm().findField("taxCode").minLengthText ='税号的长度等于15位'
					registerCompanyForm.getForm()
					.findField("contactorIdentityCode").allowBlank = false;
					registerCompanyForm.getForm().findField("contactorIdentityCode").regex =/(^\d{15}$)|(^\d{17}([0-9]|X|x)$)/;
					registerCompanyForm.getForm().findField("contactorIdentityCode").regexText ='输入的身份证号长度不对，或者号码不符合规定！15位号码应全为数字，18位号码末位可以为数字或x,X'
					registerCompanyForm.getForm()
					.findField("name").allowBlank = false;
					registerCompanyForm.getForm()
					.findField("business").allowBlank = false;
					registerCompanyForm.getForm()
					.findField("taxCode").allowBlank = false;
					registerCompanyForm.getForm()
					.findField("code").allowBlank = false;
					registerCompanyForm.getForm()
					.findField("contactor").allowBlank = false;				
					registerCompanyForm.getForm()
					.findField("businessLicenseFile").allowBlank = false;
					registerCompanyForm.getForm().findField("code").maxLength=15
					registerCompanyForm.getForm().findField("code").minLength=15
					registerCompanyForm.getForm().findField("code").maxLengthText ='营业执照的长度等于15位'
					registerCompanyForm.getForm().findField("code").minLengthText ='营业执照的长度等于15位'
						
		if (!registerCompanyForm.getForm().isValid()) {

			Ext.Msg.alert("提示", "请按照要求进行正确操作");

			return;

		}
           var value = registerCompanyForm.getForm().getValues();
           
           var  jsonAll = Ext.encode(value);


		    Ext.Msg.confirm('提示', "如果公司认证成功,所有公司基本信息将不能再修改,还继续执行吗?",
						function(button) {
			if (button == 'yes') {
	
				registerCompanyForm.getForm().submit({

				url : Uec3.App.Constants.homeUrl
						+ '/certify/registerAndCertify.do',
				method : "post",
				params:{jsonAll:jsonAll,requestRealType:2},
				waitMsg : '正在保存数据...',
				success : function(form, action) {
				
					 Ext.Msg.alert("提示","您已经注册成功,并已经请求了公司认证!",function(){
						 
							window.location.href= Uec3.App.Constants.homeUrl+ '/desktop/indexNew.do';													
						 
					 })
					
				},
				failure : function(form, action) {

					Ext.Msg.alert("错误", action.result.failure);
				}
			});
							}
						});
		

					},
					style : "margin-left:20px"
				},{
					text : '关闭',

					handler : function() {

						registerCompanyForm.ownerCt.close();

					},
					style : "margin-left:20px"
				}]
			});

		};

		var controlCompanyEvent = function() {

			registerCompany_prov_cmb.on('select', function(combox) {

						registerCompanyForm.getForm().findField('areaId')
								.setValue(combox.getValue());

					});

			registerCompany_city_cmb.on('select', function(combox) {

						registerCompanyForm.getForm().findField('areaId')
								.setValue(combox.getValue());

					});

			registerCompany_dist_cmb.on('select', function(combox) {

						registerCompanyForm.getForm().findField('areaId')
								.setValue(combox.getValue());

					});

			registerCompany_ajax.on('beforerequest', function() {

						Ext.MessageBox.wait("更新数据中...", "提示");
					});

			registerCompany_ajax.on('requestcomplete', function() {

						Ext.MessageBox.hide();
					});

		};

		componentCompanyInits();

		controlCompanyEvent();

		return registerCompanyForm;

	},

	/**
	 * Create this modules window here.
	 */
	createWindow : function() {
		var desktop = this.app.getDesktop();
		var win = desktop.getWindow('registerCompany');
		var module = this;
		if (!win) {
			win = desktop.createWindow({
						id : 'registerCompany',
						title : '注册公司',
						width :900,
						height : 500,
						iconCls : 'acc-icon',
						autoScroll : true,
						shim : false,
						animCollapse : false,
						constrainHeader : true,
						maximizable : false,
						resizable : false,
						taskbuttonTooltip : "注册公司",
						layout : "fit",
						tools : [{
									id : 'refresh',
									handler : Ext.emptyFn,
									scope : this
								}],
						items : [this.getComponents(this)]
					});
		}

		formBingingKeys(win.items.get(0),win);
		win.show();
		

	}
});